
public class NodeRecursion {

	/**
	 * @param args
	 */
	public void add(int index, T item) {
		head = add(index, item, head);
	}
	private Node<T> add(int index, T item, Node<T> current) {
		if(index == 0) {
			Node<T> splice = new Node<T>;
			splice.setDatum(item);
			splice.setNext(current);
			return splice;
		}
		if(current == null)
			throw new IndexOutOfBoundsException();
	
		current.setNext(add(index-1,item,current.getNext()));
		return current;
	}
	
	public T remove(int index) {
		T ofTheJedi = get(index);
		head = remove(index,head);
		return ofTheJedi;
	}
	private Node<T> remove(int index, Node<T> current) {
		if (current == null) {
			throw new IndexOutOfBoundsException();
		}
		
		if(index == 0) {
			return current.getNext();
		}
		
		current.setNext(remove(index-1,current.getNext()));
		return current;
	}
}
